<!doctype html>
<html>
<head>
    <title>编辑酒店</title>
    <?php $this->load->module('admin/index/page_header');?>
    <script type="text/javascript">
    window.UEDITOR_HOME_URL = "<?php echo URLPRE.'static/public/Lib/ueditor/';?>";
    </script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/ueditor/ueditor.config.js" charset="utf-8"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/ueditor/ueditor.all.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/ueditor/lang/zh-cn/zh-cn.js" charset="utf-8"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/color/color.js"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/select2/select2.min.js"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/select2/select2_locale_zh-CN.js"></script>
    <link href="<?php echo URLPRE;?>static/public/Lib/select2/select2.css" rel="stylesheet" />
    <link href="<?php echo URLPRE;?>static/public/Lib/select2/select2-bootstrap.css" rel="stylesheet" />
    <!--引入CSS-->
    <link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/public/Lib/webuploader/webuploader.css">
    <!--引入JS-->
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/webuploader/webuploader.js"></script>
</head>
<body>
<div class="wrap">
<div id="home_toptip"></div>
<div class="nav">
    <ul>
        <li><a href="<?php echo $index_url;?>">酒店列表</a></li>
        <li class="current"><a href="javascript:void(0)">编辑酒店</a></li>
    </ul>
</div>
<div class="table_full">
<form method="post" class="formvalidate" action="<?php echo $form_url;?>" name="frm">
<div class="nav">
    <ul class="cc tab" id="conf_menu">
        <li class="current" id="jiben_conf"><a href="javascript:void(0);">基本信息</a></li>
        <li id="jiage_conf"><a href="javascript:void(0);">酒店价格</a></li>
    </ul>
</div>
<div class="table_full">
<table class="tab_label" width="100%" id="jiben_config">
<col class="th" />
<col/>
<tbody>
<tr>
    <th><span class="spanMsg">*</span>酒店名称：</th>
    <td>
        <input type="text"  name="Form[name]" class="input rounded" size="60" value="<?php echo $info['name'];?>" validate="{required:true}"/>
    </td>
</tr>

<tr>
    <th>*星级：</th>
    <td>
        <select  name="Form[star]" style="width:300px;">
            <option value="1" <?php if($info['star']=='1'):?>selected<?php endif;?>>二星级以下/经济</option>
            <option value="2" <?php if($info['star']=='2'):?>selected<?php endif;?>>三星级/舒适</option>
            <option value="3" <?php if($info['star']=='3'):?>selected<?php endif;?>>四星级/高档</option>
            <option value="4" <?php if($info['star']=='4'):?>selected<?php endif;?>>五星级/豪华</option>
        </select>
    </td>
</tr>


<tr>
    <th>展示缩略图：</th>
    <td class="rowform">
        <ul>
            <li><input type="text" name="Form[thumb]" id="file_url" class="input rounded" value="<?php echo $info['thumb'];?>" style="width:350px" /></li>
            <li><div id="filePicker">选择图片</div></li>
            <li style="color: #ff2222;">图片宽高比为3：2,建议图片大小为(宽)210:(高)140</li>
        </ul>
    </td>
</tr>
<tr>
    <th>展示大图：</th>
    <td class="rowform">
        <ul>
            <li><input type="text" name="Form[banner]" id="file_banner_url" class="input rounded" value="<?php echo $info['banner'];?>" style="width:350px" /></li>
            <li><div id="filePicker_banner">选择图片</div></li>
            <li style="color: #ff2222;">图片宽高比为3：2,建议图片大小为(宽)871:(高)286</li>
        </ul>
    </td>
</tr>
<tr>
    <th>所在城市：</th>
    <td>
        <select name="Form[province]" id="province" onChange="_showdistrict(['continent', 'country', 'province', 'city','area'], 3)">
            <option value="-1" did="-1">选择省</option>
        </select>
        <select name="Form[city]" id="city"  onChange="_showdistrict(['continent', 'country', 'province', 'city','area'], 4)">
            <option value="-1" did="-1">选择市</option>
        </select>
        <select name="Form[area]" validate="{required:true,sel_min:0}" id="area">
            <option value="-1" did="-1">选择区</option>
        </select>
    </td>
</tr>
<tr>
    <th>详细地址：</th><td><input type="text"   name="Form[address]" class="input rounded" value="<?php echo $info['address'];?>" size="60" validate="{required:true}"/></td>
</tr>
<tr>
    <th>周边地标：</th><td><input type="text"   name="Form[around]" class="input rounded" value="<?php echo $info['around'];?>" size="60" validate="{required:true}"/></td>
</tr>
<tr>
    <th><span class="spanMsg">*</span>酒店所在经纬度：</th>
    <td>
        <input type="text"   name="Form[longitude]" class="input rounded" value="<?php echo $info['longitude'];?>" size="60" validate="{required:true}"/>(东经 西经,用空格分割)
    </td>
</tr>
<tr>
    <th><span class="spanMsg">*</span>订房电话：</th>
    <td>
        <input type="text" value="" name="Form[tel]" class="input rounded" size="60" validate="{required:true}"/>
    </td>
</tr>
<tr>
    <th>*酒店介绍：</th>
    <td>
        <script id="editor_introduce" name="Form[introduce]" type="text/plain"><?php echo $info['introduce'];?></script>
    </td>
</tr>
<tr>
    <th>*酒店设施：</th>
    <td>
        <script id="editor_facility" name="Form[facility]" type="text/plain"><?php echo $info['facility'];?></script>
    </td>
</tr>
<tr>
    <th>*酒店政策：</th>
    <td>
        <script id="editor_policy" name="Form[policy]" type="text/plain"><?php echo $info['policy'];?></script>
    </td>
</tr>
<tr>
    <th>*酒店交通：</th>
    <td>
        <script id="editor_traffic" name="Form[traffic]" type="text/plain"><?php echo $info['traffic'];?></script>
    </td>
</tr>
<tr>
    <th><span class="spanMsg">*</span>状态</th>
    <td class="rowform">
        <ul>
            <li>
                <label><input type="radio" value="1" name="Form[status]" <?php if($info['status']):?>checked="checked"<?php endif;?>/>启用</label>
            </li>
            <li>
                <label><input type="radio" value="0" name="Form[status]" <?php if(!$info['status']):?>checked="checked"<?php endif;?>/>禁用</label>
            </li>
        </ul>
    </td>
</tr>
</tbody>
</table>

    <table width="100%" class="list tab_label" cellpadding="0" cellspacing="0" border="0" id="jiage_config" style="display: none">
        <thead>
        <tr>
            <td colspan="6">
                <a class="add" href="javascript:void(0);" data-uri="<?php echo $ajax_add_price_url;?>" style="margin-left: 20px;" id="add_group">添加价格</a>
            </td>
        </tr>
        <tr>
            <td style="width:2%;"> </td>
            <td style="width:3%;">日期</td>
            <td style="width:3%;">价格名称</td>
            <td style="width:3%;">房间类型</td>
            <td style="width:3%;">挂牌价</td>
            <td style="width:3%;">会员价</td>
            <td>备注</td>

        </tr>
        </thead>
        <tbody id="price_cate_list">
        <?php if($go_list):?>
            <?php foreach($go_list as $key=>$val):?>
                <tr>
                    <td>
                        <a href="javascript:;" class="icon-remove-2 doDel" href="javascript:;" data-uri="<?php echo site_url('hotel/admin/delete_hotel_price?id='.$val['id']);?>" >删除 -</a>
                    </td>
                    <td><?php echo $val['go_date']?></td>
                    <td><?php echo $val['price_name']?></td>
                    <td>
                        <?php if($val['room_type']==1):?>普通标间<?php endif;?>
                        <?php if($val['room_type']==2):?>普通单间<?php endif;?>
                        <?php if($val['room_type']==3):?>豪华标间<?php endif;?>
                        <?php if($val['room_type']==4):?>豪华单间<?php endif;?>
                        <?php if($val['room_type']==5):?>豪华套房<?php endif;?>

                    </td>
                    <td><?php echo $val['ms_price']?></td>
                    <td><?php echo $val['ws_price']?></td>
                    <td><?php echo $val['remark']?> </td>
                </tr>
            <?php endforeach;?>
        <?php endif;?>

        </tbody>

    </table>


 </div>
<div class="btn_wrap">
    <div class="btn_wrap_pd">
          <input type="hidden" name="id" value="<?php echo $info['id'];?>" />
          <button type="submit" class="btn btn_submit J_ajax_submit_btn">提交</button>
    </div>
</div>
</form>
</div>
</div>

<script type="text/javascript">
    //文本编辑器
    UE.getEditor('editor_introduce');
    UE.getEditor('editor_facility');
    UE.getEditor('editor_policy');
    UE.getEditor('editor_traffic');
    //城市
    var district_url = '<?php echo site_url('admin/api/city_fetch/?id=')?>';
    _showdistrict(['continent', 'country', 'province', 'city','area'], 2, 40002, [<?php echo $info['province']?>, <?php echo $info['city']?> ,<?php echo $info['area']?>]);    _showdistrict(['d_continent', 'd_country', 'd_province', 'd_city'],0,null,[0, 0,0,0]);
    //上传图片
    upload_image("<?php echo site_url('admin/upload/ajax_upload');?>",'filePicker','file_url');
    upload_image("<?php echo site_url('admin/upload/ajax_upload');?>",'filePicker_banner','file_banner_url');



    $(function(){
        //添加团期
        $('#add_group').click(function(){
            var data_uri = $(this).attr('data-uri');
            $.dialog.load(data_uri,{
                id:'group_price',
                title:'添加价格',
                padding:'',
                resize: true,
                drag: true,
                width:'850px',
                zIndex:'100',
                fixed: true
            });
        });
    })

</script>
</body>
</html>